<?php

namespace common\validate;

class WorkTimeRecord extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    public function sceneGetWorkTimeRecord()
    {

        return $this->append("param.filter", "require|array")
            ->append("param.filter.date", "require|date");
    }

    public function sceneRecordWorkTime()
    {
        return $this->append("data.specified_date", "require")
            ->append("data.on_duty_date", "require")
            ->append("data.off_duty_date", "require")
            ->append("data.tenant_id", "require")
            ->append("data.union_id", "require");
    }

    public function sceneGetDayWorkTimeRecordList()
    {
        return $this->append("param.filter", "require|array")
            ->append("param.filter.user_id", "require")
            ->append("param.filter.tenant_id", "require")
            ->append("param.filter.start_time", "require|date")
            ->append("param.filter.end_time", "require|date");
    }

    public function sceneUpdateWorkTimeRecord()
    {
        return $this->append("data.link_id", "require")
            ->append("data.tenant_id", "require")
            ->append("data.type", "require")
            ->append("data.module_id", "require")
            ->append("data.user_id", "require")
            ->append("data.work_time", "egt:0");
    }

    public function sceneGetSpecifiedDayWorkTime()
    {
        return $this->append("param.filter", "require|array");
    }

    public function sceneTaskSearch()
    {
        return $this->append("param.filter", "array");
    }

    public function sceneBatchDelete()
    {
        return $this->append("param.filter", "require|array")
            ->append("param.filter.id", "require|array");
    }
}
